<style type="text/css">
    .title-left a{color:#888;}
    .title-left .active{color:#009997;}
</style>
<div class="comm-top">
	<div class="title-left">
		<a href="index.php" class="active">文字</a>
        &nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="single.php">单图文</a>
        &nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="multi.php">多图文</a>
	</div>
	<div class="title-right">
    <form method="get" action="">
        <input name="keyword" class="textarea search_inp" placeholder="关键字" type="text" value="<{$smarty.get.keyword}>"/>
        <input value="搜索" class="btn btn-success search_btn" type="submit" />
        <input value="添加<{$cateName}>" class="btn btn-success search_btn" type="button" onclick="location.href='index.php?a=add'">
    </form>
	</div>
</div>
<div class="list-table">
	<div class="wrapper">
		<table class="stable">
			<thead>
				<tr>
					<th>关键词</th>
					<th>回复内容</th>
					<th>推送量</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
                <form id="memberForm">
                <{foreach from=$list item=v}>
					<tr>
						<td><{$v.keyword}></td>
						<td><{$v.info_intro}></td>
						<td><{$v.push_num}></td>
						<{if $v.state==1}><td style="color:#009997;font-weight:bold;">开放中</td><{else}><td style="color:#aaa">已关闭</td><{/if}>
						<td><div class="btn-operate">
                            <a href="index.php?a=add&id=<{$v.id}>" title="修改"><i class="glyphicon glyphicon-edit"></i></a>
                            <a href="javascript:void(0);" onclick="delRow('<{$v.id}>',this)" title="删除" id="delBtn<{$v.id}>"><i class="glyphicon glyphicon-trash"></i></a>
                        </div></td>
					</tr>
                <{/foreach}>
                </form>
			</tbody>
		</table>
	</div>
</div>
<{if $page}><div class="page-list"><{$page}></div><{/if}>
<script type="text/javascript">
function delRow(id,obj){
    if(confirm('确定要删除吗？')){
        $.post('index.php',{a:'del',id:id},function(res){
            res=$.trim(res);
            if(res=='suc'){
                note_info('删除成功',obj);
                setTimeout('location.reload()',1200);
            }else{
                note_info('删除失败',obj,'warn');
            }
        });
    }
}
</script>